/**
   * 获取本地图
   * @param name // 文件名 如 doc.png
   * @returns {*|string}
   */
export function getAssetsImages(name: string):string {
  return new URL(`/src/assets/${name}`, import.meta.url).href;
}
function addZero (num) {
  if (parseInt(num) < 10) {
    num = '0' + num
  }
  return num
}
export function getNowFormatDate() {
  var date = new Date();
  var year = date.getFullYear();
  var month = date.getMonth() + 1;
  var strDate = date.getDate();
  let formateHour = date.getHours()
  let state = ''
  if (formateHour >= 0 && formateHour <= 10) {
    state = `早上好`;
  } else if (formateHour > 10 && formateHour <= 14) {
    state = `中午好`;
  } else if (formateHour > 14 && formateHour <= 18) {
    state = `下午好`;
  } else if (formateHour > 18 && formateHour <= 24) {
    state = `晚上好`;
  }
  var hour= addZero(formateHour);//得到小时数
  var minute= addZero(date.getMinutes());//得到分钟数
  var second= date.getSeconds();//得到秒数
  // 获取今天是周几，0表示周日，1表示周一，以此类推直到6表示周六
  var dayOfWeek = date.getDay();
  // 创建一个数组，存储一周七天的名称
  var daysOfWeek = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  return {
    year,
    month,
    strDate,
    hour,
    minute,
    second,
    state,
    week: daysOfWeek[dayOfWeek]
  };
}